import { defineStore } from "pinia";

const useLoginStore = defineStore("login", {
    state: () => ({
        reg_phone : /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/,
        reg_password : /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,16}$/,
        reg_veriCode : /^\d{4}$/,
        // 当前用户信息
        user_id:null,
        mobile:null,
        username:null,
    }),
    actions: {
      setUserMessage(user_id,username,mobile) {
        this.user_id = user_id;
        this.username = username;
        this.mobile = mobile;
      }
    }
  })
  
  export default useLoginStore